﻿using System.Web.Http;
using System.Web.Mvc;

namespace Sportsbook.Website.Areas.Api
{
	public class ApiAreaRegistration : AreaRegistration
	{
		public override string AreaName
		{
			get
			{
				return "Api";
			}
		}

		public override void RegisterArea(AreaRegistrationContext context)
		{
			context.Routes.MapHttpRoute(
			 name: "Api_BetList",
			 routeTemplate: "api/bet-list/{customerId}",
			 defaults: new { controller = "BetList" }
		 );

			context.Routes.MapHttpRoute(
			  name: "Api_BetSlip",
			  routeTemplate: "api/bet-slip/{customerId}",
			  defaults: new { controller = "BetSlip" }
			);

			context.Routes.MapHttpRoute(
			 name: "Api_Leagues",
			 routeTemplate: "api/leagues/{sportId}/{filterType}",
			 defaults: new { controller = "Leagues" }
			);

			context.Routes.MapHttpRoute(
				name: "Api_Lines",
				routeTemplate: "api/lines/{sportId}/{filterType}/{leagueId}",
				defaults: new { controller = "Lines" }
			);

			context.Routes.MapHttpRoute(
				name: "Api_Default",
				routeTemplate: "api/{controller}/{id}",
				defaults: new { id = RouteParameter.Optional }
			);
		}
	}
}
